package org.terrier.matching.models.basicmodel;

import org.terrier.utility.ApplicationSetup;

import uk.ac.gla.terrier.statistics.HKGammaFunction;

public class EXPcdf extends BasicModel {
	/*
     * exp pdf 
     */
    double lambda = Double.parseDouble(ApplicationSetup.getProperty(
    		"distribution.parameter.0", "0.8"));//0.71

	@Override
	public String getInfo() {
		return "EXPcdf";
	}

	@Override
	public double score(double tf, double documentFrequency,
			double termFrequency, double keyFrequency, double documentLength) {
		/*
		 * exponential
		 */	
		return (1 -  Math.exp(- lambda * tf))*keyFrequency;
	}
	
	public void initModel(){
		String value = null;
		if ((value = ApplicationSetup.getProperty("distribution.parameter.0", "0.8d"))!=null){
			this.lambda = Double.parseDouble(value);
		}
	}

}
